package com.lantosec.hmrp.modules.sysdata.vo;

import java.util.Date;

import com.lantosec.hmrp.modules.sysdata.entity.SysDataSerialNumber;
import com.lantosec.hmrp.core.mvc.BaseVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * <p>
 * 流水号规则表 VO对象
 * </p>
 *
 * @author AutoCode
 * @since 2020-06-22
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value="SysDataSerialNumber对象", description="流水号规则表")
public class SysDataSerialNumberVO extends BaseVO<SysDataSerialNumber> {
    private static final long serialVersionUID = 1L;


    public SysDataSerialNumberVO(SysDataSerialNumber entity){
        this.id = entity.getId();
        this.serialName = entity.getSerialName();
        this.serialDesc = entity.getSerialDesc();
        this.serialRules = entity.getSerialRules();
        this.startValue = entity.getStartValue();
        this.increment = entity.getIncrement();
        this.currentNumber = entity.getCurrentNumber();
        this.resetCycle = entity.getResetCycle();
        this.createTime = entity.getCreateTime();
        this.updateTime = entity.getUpdateTime();
    }

    @Override
    public SysDataSerialNumber convertToEntity(){
        return new SysDataSerialNumber(this);
    }


    @ApiModelProperty(value = "ID")
    private String id;

    @ApiModelProperty(value = "名称")
    private String serialName;

    @ApiModelProperty(value = "描述")
    private String serialDesc;

    @ApiModelProperty(value = "规则")
    private String serialRules;

    @ApiModelProperty(value = "初始值")
    private Integer startValue;

    @ApiModelProperty(value = "增量")
    private Integer increment;

    @ApiModelProperty(value = "当前值")
    private Integer currentNumber;

    @ApiModelProperty(value = "重置周期:年 YEAR，月 MONTH，周 WEEK，日 DAY")
    private String resetCycle;

    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    @ApiModelProperty(value = "修改时间")
    private Date updateTime;


}
